package servlet;

import java.io.IOException;
import java.sql.SQLException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import action.common.RepertoryAction;
public class DeleteRepertory extends HttpServlet {
	private static final long serialVersionUID = 1L;
    public DeleteRepertory() {
        super();
    }

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doPost(request, response);	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

String id=request.getParameter("id");
RepertoryAction act=new RepertoryAction();
try {
	act.delete(Integer.parseInt(id));
} catch (NumberFormatException | SQLException e) {
	// TODO Auto-generated catch block
	e.printStackTrace();
} 
response.sendRedirect("repertory.jsp");
	}

}
